package com.sxmd.myapplication;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import java.util.LinkedHashMap;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private FreeSchedule myview;
    private LinkedHashMap<String, String> mapDate;
    private List<Prog> progs;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        myview = (FreeSchedule) findViewById(R.id.myview);


        StringData stringData = new StringData();
        stringData.initData();
        List<Prog> tt = stringData.getTT();
        LinkedHashMap nextServenDays = stringData.getNextServenDays();
        myview.setMapDate(nextServenDays);
        myview.setProgs(tt);
        myview.setMonth(stringData.getMonth());
//        mapDate = new LinkedHashMap<>();
//        String startTime = "13:00";
//        String endTime = "15:00";
//        String day = "7";
//
////        mapDate.put("1", "一");
//        mapDate.put("2", "二");
//        mapDate.put("3", "三");
//        mapDate.put("4", "四");
//        mapDate.put("5", "五");
//        mapDate.put("6", "六");
//        mapDate.put("7", "日");
//        mapDate.put("8", "一");
//        String[] time = new String[]{
//                "07:00", "08.00", "09:00", "10:00", "11:00", "12:00",
//                "0",
//                "13:00", "14:00", "15:00", "16:00", "17:00", "18:00",
//                "0",
//                "19:00", "20:00", "21:00", "22:00"};
//        //遍历 7 号这天在不在map集合里面,找到下标
//        //开始时间 的下标
//        //结束时间的下标
//
//
//
//        progs = new ArrayList<>();
//        progs.add(new Prog(1, 17, 2));
//        progs.add(new Prog(1, 7, 0));
//        progs.add(new Prog(0, 9, 6));
//        progs.add(new Prog(10, 13, 6));
//        progs.add(new Prog(0, 3, 3));
//        progs.add(new Prog(4, 16, 4));
//        progs.add(new Prog(10, 17, 5));
//        myview.setMapDate(mapDate);
//        myview.setProgs(progs);
    }
}
